package com.xbongbong.paas.domain.entity.ext;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.saas.domain.entity.ProductWarehouseEntity;
import com.xbongbong.saas.enums.SheetAloneEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Map;

/**
 * @author: wufeng
 * @date: 2018/8/27 17:03
 * @desrcption: 表单数据扩展
 */
@ToString(callSuper = true)
@Getter
@Setter
public class PaasFormDataEntityExt extends PaasFormDataEntity {

    private static final long serialVersionUID = 2311783560211135579L;
    /**
     * 标题，需要生成
     */
    private String title;

    /**
     * 创建者名称
     */
    private String creatorName;
    /**
     * 标签池
     */
    private JSONObject tagData;

    /**
     * 列表支持更新回显的数据源
     */
    private JSONObject sourceData;
    /**
     * 选择产品列表返回数据
     */
    private JSONObject productData;
    /**
     * 工单状态(1未接收,2进行中,3已完成,4已关闭)
     */
    private Integer status;
    /**
     * 发票是否跨月
     */
    private Boolean crossMonth;
    /**
     * 类型（工单有用）
     */
    private Integer type;
    /**
     * 父产品id
     */
    private Long parentId;
    /**
     * 有这条数据的删除的权限
     */
    private Boolean delPermission;
    /**
     * 有这条数据的编辑的权限
     */
    private Boolean editPermission;

    private Integer operationFlag;
    /**
     * 超时提醒预警颜色
     */
    private Map<String, Map<String,String>> cellStyle;
    /**
     * 组号（报价单）
     */
    private String groupNumber;

    /**
     * 相同则为同一分组回款单(合并回款)
     */
    private String uuid;

    /**
     * 默认1，1只有父无子 2父 3子
     * @see SheetAloneEnum
     */
    private Integer alone;

    /**
     * 预付款余额
     */
    private Double advancePaymentBalance;
    /**
     * 待核销的合同个数
     */
    private Integer contractCount;
    /**
     * 预付款余额
     */
    private Double advancePayBalance;
    /**
     * 待核销的采购合同个数
     */
    private Integer purchaseCount;
    /**
     * 处理合同的已收款金额，核销单金额+回款单金额-应收款的已收金额
     */
    private Double finishAmount;

    /**
     * 预警用，预警数据
     */
    private ProductWarehouseEntity productWarehouseEntity;

    /**
     * 最原始数据
     */
    private JSONObject originData;

    private Long refProductId;
    /**
     * 批次 sku+批次号+生产日期+保质期+仓库
     */
    private String batchStockKey;
    /**
     * 活动状态(0上架,1下架,3待上架)
     */
    private Integer activityStatus;
    /**
     *
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessType;
    /**
     *
     */
    private String name;
    
    @Getter(onMethod_ = {@QueryIgnore})
    private String productNo;
    
    @Getter(onMethod_ = {@QueryIgnore})
    private String productName;
    /**
     * 三方数据id
     */
    private String pid;
    /**
     *
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer saasMark;


    public PaasFormDataEntityExt() {
    }

    public PaasFormDataEntityExt(Long id, String corpid, Long appId, Long menuId, Long formId, String serialNo, String ownerId, Long departmentId, Integer flowStatus, JSONObject data, String creatorId, Long addTime, Long updateTime, Integer del) {
        super(id, corpid, appId, menuId, formId, serialNo, ownerId, departmentId, flowStatus, data, creatorId, addTime, updateTime, del);
    }
}

